package com.telit.firecommand.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.xiaolyuh.annotation.Cacheable;
import com.telit.firecommand.dto.DistrictInfoDTO;
import com.telit.firecommand.entity.GeoXzqhXiang;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GeoXzqhXiangDao extends BaseMapper<GeoXzqhXiang> {

    /**
     * 获取所有乡
     * @return
     */
    List<GeoXzqhXiang> selectAllList();

    /**
     * 查询所有乡的list
     * @return
     */
    List<DistrictInfoDTO> selectXiangCodeList(@Param("districtCode") String districtCode);

    /**
     * 查询所有乡的list
     * @return
     */
    List<DistrictInfoDTO> selectCurrentXiangCodeList(@Param("districtCode") String districtCode);

	/**
     * 根据code查询name
     * @param xiang
     * @return
     */
    String queryNameByCode(@Param("xiang")String xiang);

    /**
     * 查询所有乡
     * @return
     */
  //  @Cacheable(value = "firecommand:xiang:queryAllXiang",depict = "查询所有乡")
    List<String> queryAllXiang();

    /**
     * 根据名称查询code
     * @param districtName
     * @return
     */
    String queryCodeByName(@Param("districtName")String districtName);

    /**
     * 根据街道名称查询code
     * @param districtName
     * @return
     */
    String queryCunCodeByXiangName(@Param("districtName")String districtName);
}